package com.ymatou.idcard.api.testcase;

import java.util.Date;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.idcard.api.parameter.UpdateIdCardInfoAndPicBean;
import com.ymatou.idcard.api.service.UpdateIdCardInfoAndPicCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;

/**
 * 更新身份证订单的身份证状态接口 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_UpdateIdCardInfoAndPic {
	private static UpdateIdCardInfoAndPicBean updateCardBean;
	private static UpdateIdCardInfoAndPicCall updateCardCall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("更新身份证订单的身份证状态接口");
	}

	@Before
	public void caseUp() {
		updateCardBean = new UpdateIdCardInfoAndPicBean();
		updateCardCall = new UpdateIdCardInfoAndPicCall();

	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(updateCardCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_UpdateIdCardInfoAndPic_001() {
		Logger.start(true,"更新身份证订单的身份证状态成功");
		try {

			updateCardBean.setCardNumber("12345678944412");
			updateCardBean.setName("test_111");
			updateCardBean.setBuyerId(110);
			updateCardBean.setStatus(1);
			updateCardBean.setHasPic(true);
			updateCardBean.setMobile("1388888888");
			updateCardBean.setRightSide("http://file.ymatou.com/files/IdCard/47c29af4-c1c5-4676-81d4-0d7d1649bee8.jpg");
			updateCardBean
					.setReverseSide("http://file.ymatou.com/files/IdCard/65bb1b97-6901-404f-ad40-2db5749052ad.jpg");
			updateCardBean.setOperater("auto test");
			updateCardBean.setCardType(1);
			// updateCardBean.setBillCode("11111111");
			updateCardBean.setOrderId(110);
			updateCardBean.setUploadTime(new Date());

			updateCardCall.setData(updateCardBean);
			updateCardCall.callService();

			Logger.comment("请求报文:" + updateCardCall.getEntityString());
			Logger.comment("返回报文:" + updateCardCall.getReturnData());

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}